package com.example.qihuibao.dao

import androidx.room.*
import com.example.qihuibao.bean.*

@Dao
interface OrderInfoDao {
    @Query("SELECT * FROM OrderInfo WHERE " +
            "CantID IN (:field_CantID) AND " +
            "EmpID IN (:field_EmpID) AND " +
            "MealDate IN (:field_MealDate) AND " +
            "MealID IN (:field_MealID)")
    fun queryInEmploy(field_CantID: String,
                      field_EmpID: String,
                      field_MealDate: String,
                      field_MealID: String): RspQueryOrderInfoBean.Order?

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun save(bean: RspQueryOrderInfoBean.Order) : Long

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun saveList(users: List<RspQueryOrderInfoBean.Order>) : List<Long>?

    @Query("SELECT * FROM OrderInfo")
    fun queryAll(): List<RspQueryOrderInfoBean.Order>?
//
//    @Delete
//    fun delete(userInfo: UserInfo)
//
    @Query("DELETE FROM OrderInfo")
    fun deleteAll()
}